<!DOCTYPE html>
<html lang="en">

<head>
    <link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正在跳转中...</title>
    <meta name="description" content="">
    <link href="" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.1/weui.min.css" />
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <style type="text/css">
        body,
        html {
            margin: 0px;
            padding: 0px;
            width: 100%;
            height: 100%;
        }

        .hidden {
            display: none;
        }

        .full {
            width: 100%;
            height: 100%;
            margin: 0px auto;
            max-width: 500px;
            text-align: center;
        }

        .public-web-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .public-web-container p {
            position: absolute;
            top: 40%;
        }

        .notice-msg {
            width: 100%;
            float: left;
            line-height: 30px;
            text-align: center;
            margin: 10px 0px 20px 0px;
            padding: 0px 15px;
            box-sizing: border-box;
            color: #666666;
            font-size: 15px;
            float: left;
        }

        .notice-msg small {
            font-size: 13px;
        }

        .public-container {
            width: 100%;
            float: left;
            text-align: center;
        }

        .qrcodes-container {
            width: 100%;
            height: 150px;
            line-height: 150px;
            font-weight: 300;
            float: left;
            margin: 30px 0px;
            text-align: center;
            align-items: center;
            justify-content: center;
        }

        .qrcodes-container img {
            width: 150px;
            height: 150px;
            margin: 0px auto;
        }

        .qrcodes {
            width: 150px;
            height: 150px;
            margin: 0px auto;
            display: none;
        }

        .error-images {
            width: 80px;
            height: 80px;
            margin: 50px auto 10px auto;
        }

        .error-msg {
            width: 100%;
            float: left;
            line-height: 30px;
            text-align: center;
            padding: 0px 15px;
            box-sizing: border-box;
            color: #666666;
            font-size: 15px;
        }

        .dianji-img {
            width: 70%;
            margin: 0px 15%;
            height: auto;
            float: left;
            display: none;
        }

        .logo {
            width: 80px;
            height: auto;
            margin: 140px 0px 0px 0px;
        }

        .logo-demo {
            width: 80px;
            height: auto;
            margin: 100px 0px 0px 0px;
        }

        .button-container {
            width: 100%;
            height: 45px;
            line-height: 45px;
            font-weight: 300;
            display: flex;
        }

        .button-container-top {
            width: 100%;
            height: 65px;
            line-height: 65px;
            font-weight: 300;
            display: flex;
            position: fixed;
            top: 0px;
        }

        .button-container-bottom {
            width: 100%;
            height: 65px;
            line-height: 65px;
            font-weight: 300;
            display: flex;
            position: fixed;
            bottom: 0px;
            background-color: #CC66FE;
        }

        .button-container a {
            display: block;
            width: 90%;
            height: 50px;
            line-height: 50px;
            font-weight: 300;
            font-size: 15px;
            background-color: #06ae56;
            color: #FFFFFF;
            margin: 0px auto;
            position: relative;
            border-radius: 3px;
        }

        .button-container-top a {
            width: 100%;
            height: 65px;
            line-height: 65px;
            font-weight: 300;
            font-size: 15px;
            background-color: #06ae56;
            color: #FFFFFF;
            float: left;
            border-radius: 0px;
            animation: twinkle 0.5s alternate infinite;
        }

        .button-container-bottom a {
            width: 100%;
            height: 65px;
            line-height: 65px;
            font-weight: 300;
            font-size: 15px;
            background-color: #06ae56;
            color: #FFFFFF;
            float: left;
            border-radius: 0px;
            animation: twinkle 0.5s alternate infinite;
        }

        .button-container-none {
            display: none;
        }

        @keyframes twinkle {
            from {
                font-size: 15px;
            }

            to {
                font-size: 17px;
            }
        }

        .button-container-top-demo {
            width: 100%;
            height: 70px;
            line-height: 50px;
            font-weight: 300;
            float: left;
            padding-top: 20px;
            background-color: #06ae56;
        }

        .button-container-bottom-demo {
            width: 100%;
            height: 70px;
            line-height: 50px;
            font-weight: 300;
            float: left;
            padding-bottom: 10px;
            background-color: #06ae56;
        }

        .button-container-top-demo a {
            width: 100%;
            height: 50px;
            line-height: 50px;
            font-weight: 300;
            font-size: 15px;
            background-color: #06ae56;
            color: #FFFFFF;
            float: left;
            border-radius: 0px;
        }

        .button-container-bottom-demo a {
            width: 100%;
            height: 50px;
            line-height: 50px;
            font-weight: 300;
            font-size: 15px;
            background-color: #06ae56;
            color: #FFFFFF;
            float: left;
            border-radius: 0px;
        }

        .fullimg {
            width: 100%;
            height: auto;
            float: left;
        }

        .safe-notice {
            width: 100%;
            float: left;
            height: 40px;
            line-height: 40px;
            text-align: center;
            box-sizing: border-box;
            display: flex;
            justify-content: center;
            position: absolute;
            top: 10px;
            max-width: 500px;
            float: left;
        }

        .safe-notice img {
            width: 16px;
            height: 16px;
            margin-right: 3px;
        }

        .safe-notice p {
            width: auto;
            height: 16px;
            line-height: 16px;
            font-size: 12px;
            color: #999999;
            margin: 0px;
        }

        .safe-notice-demo {
            width: 100%;
            float: left;
            height: 40px;
            line-height: 40px;
            text-align: center;
            padding: 10px;
            box-sizing: border-box;
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }

        .safe-notice-demo img {
            width: 16px;
            height: 16px;
            margin-right: 3px;
            margin-top: 1px;
        }

        .safe-notice-demo p {
            width: auto;
            height: 20px;
            line-height: 20px;
            font-size: 12px;
            color: #999999;
            margin: 0px;
        }

        .wechat-addfriend-cotainer {
            width: 100%;
            height: 100%;
            float: left;
            text-align: center;
        }

        .wechat-addfriend-avatar {
            width: 60px;
            height: 60px;
            border-radius: 100%;
            margin: 70px auto 0px auto;
        }

        .wechat-addfriend-nike {
            width: 100%;
            height: 25px;
            line-height: 25px;
            text-align: center;
            color: #333333;
            font-weight: 400;
            font-size: 15px;
            float: left;
        }

        .wechat-addfriend-button {
            position: absolute;
            bottom: 150px;
            width: 100%;
            float: left;
            height: 60px;
        }

        .wechat-addfriend-addbutton {
            width: 50%;
            height: 40px;
            line-height: 40px;
            border-radius: 1px;
            background-color: #0bb45e;
            color: #FFFFFF;
            margin: 0px 25% 20px 25%;
            float: left;
            text-decoration: none;
        }

        .wechat-addfriend-button-descript {
            width: 100%;
            height: 40px;
            line-height: 20px;
            color: #999999;
            text-align: center;
            font-size: 14px;
            padding: 0px 20px;
            box-sizing: border-box;
            font-weight: 300;
        }

        .wechat-addfriend-button-descript font {
            color: #1A65FE;
            font-weight: 500;
            margin: 0px 2px;
        }

        .wechat-addfriend-copyright {
            position: absolute;
            bottom: 0;
            width: 100%;
            float: left;
            height: 60px;
        }

        .wechat-addfriend-copyright-name {
            width: 100%;
            height: 20px;
            line-height: 20px;
            color: #606e88;
            text-align: center;
            font-size: 15px;
        }

        .wechat-addfriend-copyright-time {
            width: 100%;
            height: 20px;
            line-height: 20px;
            color: #b0b0b0;
            text-align: center;
            font-size: 13px;
        }

        .wechat-addfriend-help {
            width: 60%;
            height: auto;
            float: left;
            margin: 20px 20%;
            display: none;
        }

        .copy-wechat-notice-shadow {
            background-color: #333333;
            width: 100%;
            height: 100%;
            z-index: 998;
            position: fixed;
            opacity: 0.8;
            display: none;
        }

        .copy-wechat-notice {
            width: 90%;
            margin: 30% 5%;
            background-color: #FFFFFF;
            border-radius: 10px;
            z-index: 999;
            position: fixed;
            height: 250px;
            padding: 30px 20px;
            box-sizing: border-box;
            text-align: center;
            display: none;
        }

        .copy-wechat-notice i {
            width: 30px;
            height: 30px;
            text-align: center;
            line-height: 30px;
            font-size: 27px;
            right: 15px;
            top: 10px;
            float: right;
            font-style: normal;
            position: absolute;
        }

        .copy-wechat-notice h3 {
            height: 30px;
            line-height: 30px;
            font-size: 18px;
            margin: 0px;
            padding: 0px;
            color: #333333;
        }

        .copy-wechat-notice h5 {
            height: 35px;
            line-height: 35px;
            margin: 0px;
            padding: 0px;
            font-weight: 400;
            color: #999999;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .copy-wechat-notice span {
            width: auto;
            padding: 5px 20px;
            background-color: #FD6666;
            color: #FFFFFF;
            border-radius: 5px;
            height: 30px;
            line-height: 30px;
            margin: 0px auto;
        }

        .copy-wechat-notice-button {
            height: 50px;
            width: 100%;
            background-color: #06ae56;
            color: #FFFFFF;
            border-radius: 50px;
            float: left;
            line-height: 50px;
            margin-top: 25px;
            display: flex;
            justify-content: center;
            align-items: center;
            text-decoration: none;
        }

        .copy-wechat-notice-button img {
            width: 20px;
            height: 20px;
            margin-right: 5px;
        }

        .copy-wechat-notice-button font {
            width: auto;
            height: 20px;
            line-height: 20px;
            padding: 0px;
        }
    </style>


    <script>
        window.onerror = e => {
            console.error(e)
        }
    </script>
</head>

<body>
<div class="page full">
    <div id="public-web-container" class="public-container">
        <div id="safe-notice" style="display:none;">
            <div class="safe-notice">
                <img
                        src="">
                <p>本链接经过<font style="font-weight: 500;color: #333333;">SSL安全加密</font>,请放心点击!</p>
            </div>
        </div>
        <div id="style_normal" style="display:none;">
            <img class="logo" src="">
            <p class="notice-msg"><small style="font-weight: 500;">正在跳转中...</small><br>如未自动打开微信请点击下方按钮
            </p>
            <div class="button-container" onclick="getInfos()">
                <a id="public-web-jump-button" type="button" class="default" style="width: 66%; margin-top: 20px;">
                        <span id="public-web-jump-button-loading"
                              class="weui-primary-loading weui-primary-loading_transparent">
                            <i class="weui-primary-loading__dot"></i>
                        </span>
                    <span style="font-weight: 500;">正在打开微信</span>
                </a>
            </div>
            <a id="dianjiimg_links" href="">
            </a>
            <div class="qrcodes-container" id="qrcodes"></div>
        </div>
        <div id="style_full" style="display:none;">
            <a id="dianjiimg_links_full" href="">
                <img class="fullimg" src="">
            </a>
            <div id="button_container_full" class="button-container-none">
                <a id="public-web-jump-button-full" href="" style="">
                </a>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        htmlInfo()
        getInfos()
    })

    function htmlInfo() {
        if (isMobile()) {
            $("#safe-notice").show();
            $("#style_normal").show();
            $(".logo").attr("src", "")
        } else {
            $("#safe-notice").hide();
            $("#style_normal").hide();
            $(".public-container").html('请使用手机访问本链接' + '</p>');
        }
    }

    function getInfos() {
        debugger
        var weixin = isWeiXin()
        if (!weixin) {
            var urlScheme = getUrlScheme();
            // var urlScheme = 'weixin://dl/business/?t=KjvmLfv8Oxc';


            // $(".public-container").html('<p class="error-msg">系统异常，请稍后重试</p>');

            $("#dianjiimg_links").attr('href', urlScheme)
            var res = {
                result: {
                    openlink: urlScheme
                }
            }
            if(urlScheme) {
                jsUpdate(res)
            }

        }
    }



    function getUrlScheme() {

        var link = getFromLocal("openlink");
        if (!link) {

            $.ajax({
                url: "http://demo.hzqcjt.com/api/wxa/scheme/wxf3894e1a18c00e23",
                type: "GET",
                success : function (res){
                    putInLocal("openlink",res.openlink,res.days * 60 * 60 * 1000)
                }
            })
            link = getFromLocal("openlink")
        }
        return link;
    }



    function jsUpdate(res) {

        var mobile_flag = isMobile();
        var weixin = isWeiXin();
        if (mobile_flag) {
            var baidu = isBaidu();
            var uc = isUc();
            var weibo = isWeibo();
            var douyin = isDouyin();
            if (weixin) {

            } else if (uc) {
                $("#public-web-jump-button").html("前往微信打开");
                $("#dianjiimg").show();
                window.location.href = res.result.openlink;
            } else if (douyin) {
                if (res.result.openlink !== '') {
                    window.location.href = res.result.openlink;
                    // $("#public-web-jump-button span").click();
                }
            } else {
                $("#dianjiimg").show();
                if (res.result.openlink !== '') {
                    window.location.href = res.result.openlink;
                    // $("#public-web-jump-button span").click();
                }
                setTimeout(function () {
                    $("#public-web-jump-button").html("前往微信打开");
                    $("#dianjiimg").show();
                }, 3000);
            }
        } else {
            if (res.result.openlink !== '') {
                window.location.href = res.result.openlink;
            }
            $(".notice-msg").html("请使用手机浏览器访问！");
        }
    }

    function isWeiXin() {

        var ua = navigator.userAgent.toLowerCase()
        var isWXWork = ua.match(/wxwork/i) === 'wxwork'
        return !isWXWork && ua.match(/micromessenger/i) === 'micromessenger';
    }

    function isDouyin() {
        ua = navigator.userAgent.toLowerCase();
        return ua.indexOf('aweme') > -1;
    }

    function isBaidu() {
        ua = navigator.userAgent.toLowerCase();
        return ua.indexOf('baiduboxapp/') > -1;
    }

    function isUc() {
        if (navigator.userAgent.match(/(UCBrowser|Quark)/i)) {
            return true;
        } else {
            return false;
        }
    }

    function isWeibo() {
        return navigator.userAgent.indexOf('Weibo') > -1;
    }

    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] === variable) {
                return pair[1];
            }
        }
        return false;
    }

    function isMobile() {
        var mobile_flag = !!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|XiaoMi|IEMobile)/i);
        var screen_width = window.screen.availWidth;
        if (screen_width < 700) {
            mobile_flag = true;
        }
        return mobile_flag;
    }

    function isIphone() {
        return !!navigator.userAgent.match(/(iPhone|iPod|ios|iPad)/i);
    }



    function putInLocal(key, value, exp) {
        var obj = {
            value,
            time: Date.now(),
            exp
        };
        // 保存当前的时间 毫秒
        localStorage.setItem(key, JSON.stringify(obj));
    }


    function getFromLocal(key) {
        var val = localStorage.getItem(key);
        if (val === null) return null;

        val = JSON.parse(val);
        if (Date.now() - val.time > val.expires) {
            // 获取数据的时候判断一下是否过期，如果过期了，就把它清除
            localStorage.removeItem(key);
            return null;
        }

        return val.value;
    }

</script>
</body>

</html>